import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmDocumentSendVO, AdmDocumentSendForm, AdmDocumentSendQuery } from '@/api/general/administration/document/send/types';

/**
 * 查询发文审批列表
 * @param query
 * @returns {*}
 */

export const listAdmDocumentSend = (query?: AdmDocumentSendQuery): AxiosPromise<AdmDocumentSendVO[]> => {
  return request({
    url: '/system/admDocumentSend/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询发文审批详细
 * @param id
 */
export const getAdmDocumentSend = (id: string | number): AxiosPromise<AdmDocumentSendVO> => {
  return request({
    url: '/system/admDocumentSend/' + id,
    method: 'get'
  });
};

/**
 * 新增发文审批
 * @param data
 */
export const addAdmDocumentSend = (data: AdmDocumentSendForm) => {
  return request({
    url: '/system/admDocumentSend',
    method: 'post',
    data: data
  });
};

/**
 * 修改发文审批
 * @param data
 */
export const updateAdmDocumentSend = (data: AdmDocumentSendForm) => {
  return request({
    url: '/system/admDocumentSend',
    method: 'put',
    data: data
  });
};

/**
 * 删除发文审批
 * @param id
 */
export const delAdmDocumentSend = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/admDocumentSend/' + id,
    method: 'delete'
  });
};
